
"✅ 界面设置插件:interface----------------------------------------------------

let g:indentLine_char_list = ['|', '¦', '┆', '┊']



"startify
"起始页列表长度
let g:startify_files_number = 20
"自动加载 session
let g:startify_session_autoload = 1

"Goyo
let g:goyo_width = 80
let g:goyo_height = "100%"



"✅主题----------------------------------------------------------------------✅







"✅ 窗口 Window--------------------------------------------------------------✅
"✅ vim-floaterm 浮动的 cmd 窗口
hi Floaterm guibg=black
" 浮动窗口边缘线颜色、前景、背景颜色
hi FloatermBorder  guifg=cyan guibg=orange

" neovim 专用设置项
" hi FloatermNC guibg=skyblue
function! s:lf_floaterm_source(...)
  let candidates = []
  let bufs = floaterm#buflist#gather()
  for bufnr in bufs
    let bufinfo = getbufinfo(bufnr)[0]
    let name = bufinfo['name']
    let title = getbufvar(bufnr, 'term_title')
    let line = printf('    %s    %s    %s', bufnr, name, title)
    call add(candidates, line)
  endfor
  return candidates
endfunction

" 与 LeaderF 一起使用
function! s:lf_floaterm_accept(line, arg) abort
  let bufnr = str2nr(matchstr(a:line, '\S'))
  call floaterm#terminal#open_existing(bufnr)
endfunction

function! s:lf_floaterm_preview(orig_buf_nr, orig_cursor, line, args) abort
  let bufnr = str2nr(matchstr(a:line, '\S'))
  let lnum = getbufinfo(bufnr)[0]['lnum']
  return [bufnr, lnum, '']
endfunction

let g:Lf_Extensions = get(g:, 'Lf_Extensions', {})
let g:Lf_Extensions.floaterm = {
            \ 'source': string(function('s:lf_floaterm_source'))[10:-3],
            \ 'accept': string(function('s:lf_floaterm_accept'))[10:-3],
            \ 'preview': string(function('s:lf_floaterm_preview'))[10:-3],
        \ }

" 与 asynctasks 一起使用
function! s:runner_proc(opts)
  let curr_bufnr = floaterm#curr()
  if has_key(a:opts, 'silent') && a:opts.silent == 1
    call floaterm#hide()
  endif
  let cmd = 'cd ' . shellescape(getcwd())
  call floaterm#terminal#send(curr_bufnr, [cmd])
  call floaterm#terminal#send(curr_bufnr, [a:opts.cmd])
  stopinsert
  if &filetype == 'floaterm' && g:floaterm_autoinsert
    call floaterm#util#startinsert()
  endif
endfunction

let g:asyncrun_runner = get(g:, 'asyncrun_runner', {})
let g:asyncrun_runner.floaterm = function('s:runner_proc')

"✅行------------------------------------------------------------------------✅


"⚠️ 状态栏 Status-------------------------------------------------------------✅

"⚠️ lightline & lightline-ale & ale
let g:lightline = {
    \'colorscheme': 'wombat',
    \'active': {'left':[
    \['mode','paste'],
    \[ 'gitbranch', 'readonly', 'filename', 'modified']],
    \'right':[
    \['linter_checking','linter_errors','linter_warnings',
    \'linter_infos','linter_ok' ]]
    \},
    \'component_expand':{
    \'linter_checking': 'lightline#ale#checking',
    \'linter_infos': 'lightline#ale#infos',
    \'linter_warnings': 'lightline#ale#warnings',
    \'linter_errors': 'lightline#ale#errors',
    \'linter_ok': 'lightline#ale#ok',
    \},
    \'component_type':{
    \'linter_checking': 'right',
    \'linter_infos': 'right',
    \'linter_warnings': 'warning',
    \'linter_errors': 'error',
    \'linter_ok': 'right',
    \},
    \'mode_map': {
    \'n' : 'Norm',
    \'i' : 'Ins',
    \'R' : 'R',
    \'v' : 'V',
    \'V' : 'V-Line',
    \"\<C-v>": 'V-Block',
    \'c' : 'Cmd',
    \'s' : 'Select',
    \'S' : 'S-Line',
    \"\<C-s>": 'S-Block',
    \'t': 'T',
    \},
\}

function! LightlineMode()
  return expand('%:t') =~# '^__Tagbar__' ? 'Tagbar':
        \expand('%:t') ==# 'ControlP' ? 'CtrlP' :
        \lightline#mode()
endfunction

let g:lightline#ale#indicator_checking = "\uf110"
let g:lightline#ale#indicator_infos = "\uf129"
let g:lightline#ale#indicator_warnings = "\uf071"
let g:lightline#ale#indicator_errors = "\uf05e"
let g:lightline#ale#indicator_ok = "\uf00c"


"⚠️ powerline

set rtp+=/usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh

set nocompatible
set t_Co=256

let g:minBufExplForceSyntaxEnable = 1
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup

set laststatus=2 
set guifont=Source\ Code\ Pro\ for\ Powerline:h12 
set noshowmode
